package com.zhipu.balance.ui.home.record

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import androidx.recyclerview.widget.LinearLayoutManager
import com.blankj.utilcode.util.SPUtils
import com.zhipu.balance.R
import com.zhipu.balance.databinding.FragmentRecordRiceBinding
import com.zhipu.balance.mobile.dao.*
import com.zhipu.balance.mobile.event.*
import com.zhipu.balance.ui.BaseFragment
import com.zhipu.balance.ui.home.record.adapter.RecordAdapter


/***
 * 使用记录
 */
class RecordRiceFragment : BaseFragment<FragmentRecordRiceBinding>() {
    /**
     * 适配器
     */
    private var mRecordAdapter = RecordAdapter()

    /**
     * 更新主类数据
     */
    var mMainClass: String = "稻谷"

    /**
     * 更新子类数据
     */
    var mSubclass: String = "杂质"


    /**
     * 查询
     */
    private var uniqueId: String = ""


    /**
     * 页数
     */
    var page = 0

    /**
     * 总页数
     */
    var alwaysPage = 1


    /**
     * 记录稻谷
     */
    lateinit var mRecordRiceList: List<RecordRice>

    /**
     * 记录小麦
     */
    lateinit var mRecordWheatList: List<RecordWheat>

    /**
     * 记录玉米
     */
    lateinit var mRecordCornList: List<RecordCorn>

    /**
     * 记录大米
     */
    lateinit var mRecordDaMiList: List<RecordDaMi>

    /**
     * 记录大豆
     */
    lateinit var mRecordSoybeanList: List<RecordSoybean>

    /**
     * 记录油菜籽
     */
    lateinit var mRecordRapeseedList: List<RecordRapeseed>


    /**
     * 初始化根布局
     *
     * @return 布局layout的id
     */
    override fun initContentView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): Int {
        return R.layout.fragment_record_rice
    }


    override fun initView() {
        super.initView()
        //
        binding.rv.layoutManager = LinearLayoutManager(mContext)
        binding.rv.adapter = mRecordAdapter

    }

    /**
     * 唯一识别码
     */
    fun setUniqueId(uniqueId: String) {
        this.uniqueId = uniqueId
        UpdateDataMainClass(this.mMainClass)
    }

    /**
     * 更新主类数据
     */
    fun UpdateDataMainClass(mMainClass: String) {
        mRecordAdapter.setStringDetectionName(mMainClass)
        this.mMainClass = mMainClass
        //页数
        page = 0
        when (mMainClass) {
            "稻谷" -> {
                var alwaysPage = RecordRiceDao.getInstance().TotalCount(uniqueId).toInt()
                this.alwaysPage = if (alwaysPage % 9 == 0) alwaysPage / 9 else alwaysPage / 9 + 1
                println("稻谷页数${this.alwaysPage}")
                mRecordRiceList = RecordRiceDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordRice(mRecordRiceList)
            }
            "小麦" -> {
                var alwaysPage = RecordWheatDao.getInstance().TotalCount(uniqueId).toInt()
                this.alwaysPage = if (alwaysPage % 9 == 0) alwaysPage / 9 else alwaysPage / 9 + 1
                println("小麦页数${this.alwaysPage}")
                mRecordWheatList = RecordWheatDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordWheat(mRecordWheatList)
            }
            "玉米" -> {
                var alwaysPage = RecordCornDao.getInstance().TotalCount(uniqueId).toInt()
                this.alwaysPage = if (alwaysPage % 9 == 0) alwaysPage / 9 else alwaysPage / 9 + 1
                println("玉米页数${this.alwaysPage}")
                mRecordCornList = RecordCornDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordCorn(mRecordCornList)
            }
            "大米" -> {
                var alwaysPage = RecordDaMiDao.getInstance().TotalCount(uniqueId).toInt()
                this.alwaysPage = if (alwaysPage % 9 == 0) alwaysPage / 9 else alwaysPage / 9 + 1
                println("大米页数${this.alwaysPage}")
                mRecordDaMiList = RecordDaMiDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordDaMi(mRecordDaMiList)
            }
            "大豆" -> {
                var alwaysPage = RecordSoybeanDao.getInstance().TotalCount(uniqueId).toInt()
                this.alwaysPage = if (alwaysPage % 9 == 0) alwaysPage / 9 else alwaysPage / 9 + 1
                println("大豆页数${this.alwaysPage}")
                mRecordSoybeanList = RecordSoybeanDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordSoybean(mRecordSoybeanList)
            }
            "油菜籽" -> {
                var alwaysPage = RecordRapeseedDao.getInstance().TotalCount(uniqueId).toInt()
                this.alwaysPage = if (alwaysPage % 9 == 0) alwaysPage / 9 else alwaysPage / 9 + 1
                println("油菜籽页数${this.alwaysPage}")
                mRecordRapeseedList = RecordRapeseedDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordRapeseed(mRecordRapeseedList)
            }
        }
        UpdateDataSubclass(this.mSubclass)
    }

    /**
     * 更新子类
     */
    fun UpdateDataSubclass(mSubclass: String) {
        this.mSubclass = mSubclass
        /**
         * 操作项
         */
        mRecordAdapter.setStringCategory(mSubclass)
        if (null == binding) {
            return
        }
        when (this.mMainClass) {
            "稻谷" -> {
                when (mSubclass) {
                    "杂质" -> {
                        binding.NameOne.text = "大样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "大样杂质"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "大样杂质率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "小样质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "小样杂质"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = "小样杂质率"
                        binding.NameSix.visibility = View.VISIBLE
                        binding.NameSeven.text = "总杂质率"
                        binding.NameSeven.visibility = View.VISIBLE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.VISIBLE
                        binding.ViewSeven.visibility = View.VISIBLE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "出糙" -> {
                        binding.NameOne.text = "出糙质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "完整糙米"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "不完善糙米"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "出糙率"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "整精米" -> {
                        binding.NameOne.text = "整精试样"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "整精米质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "整精米率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "谷外糙米" -> {
                        binding.NameOne.text = "糙米试样"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "糙米质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "谷外糙米率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "黄粒米" -> {
                        binding.NameOne.text = "黄粒米试样"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "黄粒米质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "黄粒米率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE

                    }
                    "互混" -> {
                        binding.NameOne.text = "互混试样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "异种粮质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "互混率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "出米率" -> {
                        binding.NameOne.text = "总稻谷量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "出米量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "出米率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                }
            }
            "小麦" -> {
                when (mSubclass) {
                    "杂质" -> {
                        binding.NameOne.text = "大样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "大样杂质"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "大样杂质率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "小样质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "小样杂质"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = "小样杂质率"
                        binding.NameSix.visibility = View.VISIBLE
                        binding.NameSeven.text = "矿物质量"
                        binding.NameSeven.visibility = View.VISIBLE
                        binding.NameEight.text = "矿物质含量"
                        binding.NameEight.visibility = View.VISIBLE
                        binding.NameNine.text = "总杂质率"
                        binding.NameNine.visibility = View.VISIBLE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE

                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.VISIBLE
                        binding.ViewSeven.visibility = View.VISIBLE
                        binding.ViewEight.visibility = View.VISIBLE
                        binding.ViewNine.visibility = View.VISIBLE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "不完善" -> {
                        if(SPUtils.getInstance().getBoolean("ImperfectSubdivision",false)){
                            binding.NameOne.text = "虫蚀粒"
                            binding.NameOne.visibility = View.VISIBLE
                            binding.NameTwo.text = "虫蚀率率"
                            binding.NameTwo.visibility = View.VISIBLE
                            binding.NameThree.text = "病斑粒"
                            binding.NameThree.visibility = View.VISIBLE
                            binding.NameFour.text = "病斑粒率"
                            binding.NameFour.visibility = View.VISIBLE
                            binding.NameFive.text = "赤霉病粒"
                            binding.NameFive.visibility = View.VISIBLE
                            binding.NameSix.text = "赤霉病粒率"
                            binding.NameSix.visibility = View.VISIBLE
                            binding.NameSeven.text = "破损粒"
                            binding.NameSeven.visibility = View.VISIBLE
                            binding.NameEight.text = "破损粒率"
                            binding.NameEight.visibility = View.VISIBLE
                            binding.NameNine.text = "生芽粒"
                            binding.NameNine.visibility = View.VISIBLE
                            binding.NameTen.text = "生芽粒率"
                            binding.NameTen.visibility = View.VISIBLE
                            binding.NameEleven.text = "生霉粒"
                            binding.NameEleven.visibility = View.VISIBLE
                            binding.NameTwelve.text = "生霉粒率"
                            binding.NameTwelve.visibility = View.VISIBLE
                            binding.NameThirteen.text = "热损伤粒"
                            binding.NameThirteen.visibility = View.VISIBLE
                            binding.NameFourteen.text = "热损伤粒率"
                            binding.NameFourteen.visibility = View.VISIBLE
                            binding.NameFifteen.text = "霉变粒率"
                            binding.NameFifteen.visibility = View.VISIBLE
                            binding.NameSixteen.text = "霉变粒率"
                            binding.NameSixteen.visibility = View.VISIBLE
                            binding.NameSeventeen.text = "不完善粒率"
                            binding.NameSeventeen.visibility = View.VISIBLE
                            //线
                            binding.ViewOne.visibility = View.VISIBLE
                            binding.ViewTwo.visibility = View.VISIBLE
                            binding.ViewThree.visibility = View.VISIBLE
                            binding.ViewFour.visibility = View.VISIBLE
                            binding.ViewFive.visibility = View.VISIBLE
                            binding.ViewSix.visibility = View.VISIBLE
                            binding.ViewSeven.visibility = View.VISIBLE
                            binding.ViewEight.visibility = View.VISIBLE
                            binding.ViewNine.visibility = View.VISIBLE
                            binding.ViewTen.visibility = View.VISIBLE
                            binding.ViewEleven.visibility = View.VISIBLE
                            binding.ViewTwelve.visibility = View.VISIBLE
                            binding.ViewThirteen.visibility = View.VISIBLE
                            binding.ViewFourteen.visibility = View.VISIBLE
                            binding.ViewFifteen.visibility = View.VISIBLE
                            binding.ViewSixteen.visibility = View.VISIBLE
                            binding.ViewSeventeen.visibility = View.VISIBLE
                        }else{
                            binding.NameOne.text = "不完善粒"
                            binding.NameOne.visibility = View.VISIBLE
                            binding.NameTwo.text = "不完善粒率"
                            binding.NameTwo.visibility = View.VISIBLE
                            binding.NameThree.text = ""
                            binding.NameThree.visibility = View.GONE
                            binding.NameFour.text = ""
                            binding.NameFour.visibility = View.GONE
                            binding.NameFive.text = ""
                            binding.NameFive.visibility = View.GONE
                            binding.NameSix.text = ""
                            binding.NameSix.visibility = View.GONE
                            binding.NameSeven.text = ""
                            binding.NameSeven.visibility = View.GONE
                            binding.NameEight.text = ""
                            binding.NameEight.visibility = View.GONE
                            binding.NameNine.text = ""
                            binding.NameNine.visibility = View.GONE
                            binding.NameTen.text = ""
                            binding.NameTen.visibility = View.GONE
                            binding.NameEleven.text = ""
                            binding.NameEleven.visibility = View.GONE
                            binding.NameTwelve.text = ""
                            binding.NameTwelve.visibility = View.GONE
                            binding.NameThirteen.text = ""
                            binding.NameThirteen.visibility = View.GONE
                            binding.NameFourteen.text = ""
                            binding.NameFourteen.visibility = View.GONE
                            binding.NameFifteen.text = ""
                            binding.NameFifteen.visibility = View.GONE
                            binding.NameSixteen.text = ""
                            binding.NameSixteen.visibility = View.GONE
                            binding.NameSeventeen.text = ""
                            binding.NameSeventeen.visibility = View.GONE
                            //线
                            binding.ViewOne.visibility = View.VISIBLE
                            binding.ViewTwo.visibility = View.VISIBLE
                            binding.ViewThree.visibility = View.GONE
                            binding.ViewFour.visibility = View.GONE
                            binding.ViewFive.visibility = View.GONE
                            binding.ViewSix.visibility = View.GONE
                            binding.ViewSeven.visibility = View.GONE
                            binding.ViewEight.visibility = View.GONE
                            binding.ViewNine.visibility = View.GONE
                            binding.ViewTen.visibility = View.GONE
                            binding.ViewEleven.visibility = View.GONE
                            binding.ViewTwelve.visibility = View.GONE
                            binding.ViewThirteen.visibility = View.GONE
                            binding.ViewFourteen.visibility = View.GONE
                            binding.ViewFifteen.visibility = View.GONE
                            binding.ViewSixteen.visibility = View.GONE
                            binding.ViewSeventeen.visibility = View.GONE
                        }
                    }
                    "面筋" -> {
                        binding.NameOne.text = "试样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "湿面筋质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "湿面筋含量"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "干面筋质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "干面筋含量"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = "面筋吸水率"
                        binding.NameSix.visibility = View.VISIBLE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.VISIBLE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE

                    }
                    "容重" -> {
                        binding.NameOne.text = "容重质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "容重结果"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                }
            }
            "玉米" -> {
                when (mSubclass) {
                    "杂质" -> {
                        binding.NameOne.text = "大样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "大样杂质"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "大样杂质率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "小样质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "小样杂质"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = "小样杂质率"
                        binding.NameSix.visibility = View.VISIBLE
                        binding.NameSeven.text = "总杂质率"
                        binding.NameSeven.visibility = View.VISIBLE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.VISIBLE
                        binding.ViewSeven.visibility = View.VISIBLE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "不完善" -> {
                        if(SPUtils.getInstance().getBoolean("ImperfectSubdivision",false)){
                            binding.NameOne.text = "虫蚀粒"
                            binding.NameOne.visibility = View.VISIBLE
                            binding.NameTwo.text = "虫蚀粒率"
                            binding.NameTwo.visibility = View.VISIBLE
                            binding.NameThree.text = "病斑粒"
                            binding.NameThree.visibility = View.VISIBLE
                            binding.NameFour.text = "病斑粒率"
                            binding.NameFour.visibility = View.VISIBLE
                            binding.NameFive.text = "破损粒"
                            binding.NameFive.visibility = View.VISIBLE
                            binding.NameSix.text = "破损粒率"
                            binding.NameSix.visibility = View.VISIBLE
                            binding.NameSeven.text = "生芽粒"
                            binding.NameSeven.visibility = View.VISIBLE
                            binding.NameEight.text = "生芽粒率"
                            binding.NameEight.visibility = View.VISIBLE
                            binding.NameNine.text = "生霉粒"
                            binding.NameNine.visibility = View.VISIBLE
                            binding.NameTen.text = "生霉粒率"
                            binding.NameTen.visibility = View.VISIBLE
                            binding.NameEleven.text = "热损伤粒"
                            binding.NameEleven.visibility = View.VISIBLE
                            binding.NameTwelve.text = "热损伤粒率"
                            binding.NameTwelve.visibility = View.VISIBLE
                            binding.NameThirteen.text = "赤霉病粒"
                            binding.NameThirteen.visibility = View.VISIBLE
                            binding.NameFourteen.text = "赤霉病粒率"
                            binding.NameFourteen.visibility = View.VISIBLE
                            binding.NameFifteen.text = "不完善粒率"
                            binding.NameFifteen.visibility = View.VISIBLE
                            binding.NameSixteen.text = ""
                            binding.NameSixteen.visibility = View.GONE
                            binding.NameSeventeen.text = ""
                            binding.NameSeventeen.visibility = View.GONE
                            //线
                            binding.ViewOne.visibility = View.VISIBLE
                            binding.ViewTwo.visibility = View.VISIBLE
                            binding.ViewThree.visibility = View.VISIBLE
                            binding.ViewFour.visibility = View.VISIBLE
                            binding.ViewFive.visibility = View.VISIBLE
                            binding.ViewSix.visibility = View.VISIBLE
                            binding.ViewSeven.visibility = View.VISIBLE
                            binding.ViewEight.visibility = View.VISIBLE
                            binding.ViewNine.visibility = View.VISIBLE
                            binding.ViewTen.visibility = View.VISIBLE
                            binding.ViewEleven.visibility = View.VISIBLE
                            binding.ViewTwelve.visibility = View.VISIBLE
                            binding.ViewThirteen.visibility = View.VISIBLE
                            binding.ViewFourteen.visibility = View.VISIBLE
                            binding.ViewFifteen.visibility = View.VISIBLE
                            binding.ViewSixteen.visibility = View.GONE
                            binding.ViewSeventeen.visibility = View.GONE
                        }else{
                            binding.NameOne.text = "不完善粒"
                            binding.NameOne.visibility = View.VISIBLE
                            binding.NameTwo.text = "不完善粒率"
                            binding.NameTwo.visibility = View.VISIBLE
                            binding.NameThree.text = ""
                            binding.NameThree.visibility = View.GONE
                            binding.NameFour.text = ""
                            binding.NameFour.visibility = View.GONE
                            binding.NameFive.text = ""
                            binding.NameFive.visibility = View.GONE
                            binding.NameSix.text = ""
                            binding.NameSix.visibility = View.GONE
                            binding.NameSeven.text = ""
                            binding.NameSeven.visibility = View.GONE
                            binding.NameEight.text = ""
                            binding.NameEight.visibility = View.GONE
                            binding.NameNine.text = ""
                            binding.NameNine.visibility = View.GONE
                            binding.NameTen.text = ""
                            binding.NameTen.visibility = View.GONE
                            binding.NameEleven.text = ""
                            binding.NameEleven.visibility = View.GONE
                            binding.NameTwelve.text = ""
                            binding.NameTwelve.visibility = View.GONE
                            binding.NameThirteen.text = ""
                            binding.NameThirteen.visibility = View.GONE
                            binding.NameFourteen.text = ""
                            binding.NameFourteen.visibility = View.GONE
                            binding.NameFifteen.text = ""
                            binding.NameFifteen.visibility = View.GONE
                            binding.NameSixteen.text = ""
                            binding.NameSixteen.visibility = View.GONE
                            //线
                            binding.ViewOne.visibility = View.VISIBLE
                            binding.ViewTwo.visibility = View.VISIBLE
                            binding.ViewThree.visibility = View.GONE
                            binding.ViewFour.visibility = View.GONE
                            binding.ViewFive.visibility = View.GONE
                            binding.ViewSix.visibility = View.GONE
                            binding.ViewSeven.visibility = View.GONE
                            binding.ViewEight.visibility = View.GONE
                            binding.ViewNine.visibility = View.GONE
                            binding.ViewTen.visibility = View.GONE
                            binding.ViewEleven.visibility = View.GONE
                            binding.ViewTwelve.visibility = View.GONE
                            binding.ViewThirteen.visibility = View.GONE
                            binding.ViewFourteen.visibility = View.GONE
                            binding.ViewFifteen.visibility = View.GONE
                            binding.ViewSixteen.visibility = View.GONE

                        }
                    }
                    "容重" -> {
                        binding.NameOne.text = "容重重量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "容重结果"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                }
            }
            "大米" -> {
                when (mSubclass) {
                    "杂质" -> {
                        binding.NameOne.text = "试样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "大米杂质"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "杂质率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "不完善" -> {
                        if(SPUtils.getInstance().getBoolean("ImperfectSubdivision",false)){
                            binding.NameOne.text = "试样质量"
                            binding.NameOne.visibility = View.VISIBLE
                            binding.NameTwo.text = "不完善粒率"
                            binding.NameTwo.visibility = View.VISIBLE
                            binding.NameThree.text = "未熟粒"
                            binding.NameThree.visibility = View.VISIBLE
                            binding.NameFour.text = "未熟粒率"
                            binding.NameFour.visibility = View.VISIBLE
                            binding.NameFive.text = "虫蚀粒"
                            binding.NameFive.visibility = View.VISIBLE
                            binding.NameSix.text = "虫蚀粒率"
                            binding.NameSix.visibility = View.VISIBLE
                            binding.NameSeven.text = "病斑粒"
                            binding.NameSeven.visibility = View.VISIBLE
                            binding.NameEight.text = "病斑粒率"
                            binding.NameEight.visibility = View.VISIBLE
                            binding.NameNine.text = "生霉粒"
                            binding.NameNine.visibility = View.VISIBLE
                            binding.NameTen.text = "生霉粒率"
                            binding.NameTen.visibility = View.VISIBLE
                            binding.NameEleven.text = "糙米粒"
                            binding.NameEleven.visibility = View.VISIBLE
                            binding.NameTwelve.text = "糙米粒率"
                            binding.NameTwelve.visibility = View.VISIBLE
                            binding.NameThirteen.text = ""
                            binding.NameThirteen.visibility = View.GONE
                            binding.NameFourteen.text = ""
                            binding.NameFourteen.visibility = View.GONE
                            binding.NameFifteen.text = ""
                            binding.NameFifteen.visibility = View.GONE
                            binding.NameSixteen.text = ""
                            binding.NameSixteen.visibility = View.GONE
                            binding.NameSeventeen.text = ""
                            binding.NameSeventeen.visibility = View.GONE
                            //线
                            binding.ViewOne.visibility = View.VISIBLE
                            binding.ViewTwo.visibility = View.VISIBLE
                            binding.ViewThree.visibility = View.VISIBLE
                            binding.ViewFour.visibility = View.VISIBLE
                            binding.ViewFive.visibility = View.VISIBLE
                            binding.ViewSix.visibility = View.VISIBLE
                            binding.ViewSeven.visibility = View.VISIBLE
                            binding.ViewEight.visibility = View.VISIBLE
                            binding.ViewNine.visibility = View.VISIBLE
                            binding.ViewTen.visibility = View.VISIBLE
                            binding.ViewEleven.visibility = View.VISIBLE
                            binding.ViewTwelve.visibility = View.VISIBLE
                            binding.ViewThirteen.visibility = View.GONE
                            binding.ViewFourteen.visibility = View.GONE
                            binding.ViewFifteen.visibility = View.GONE
                            binding.ViewSixteen.visibility = View.GONE
                            binding.ViewSeventeen.visibility = View.GONE
                        }else{
                            binding.NameOne.text = "试样质量"
                            binding.NameOne.visibility = View.VISIBLE
                            binding.NameTwo.text = "不完善粒率"
                            binding.NameTwo.visibility = View.VISIBLE
                            binding.NameThree.text = "不完善粒率"
                            binding.NameThree.visibility = View.VISIBLE
                            binding.NameFour.text = ""
                            binding.NameFour.visibility = View.GONE
                            binding.NameFive.text = ""
                            binding.NameFive.visibility = View.GONE
                            binding.NameSix.text = ""
                            binding.NameSix.visibility = View.GONE
                            binding.NameSeven.text = ""
                            binding.NameSeven.visibility = View.GONE
                            binding.NameEight.text = ""
                            binding.NameEight.visibility = View.GONE
                            binding.NameNine.text = ""
                            binding.NameNine.visibility = View.GONE
                            binding.NameTen.text = ""
                            binding.NameTen.visibility = View.GONE
                            binding.NameEleven.text = ""
                            binding.NameEleven.visibility = View.GONE
                            binding.NameTwelve.text = ""
                            binding.NameTwelve.visibility = View.GONE
                            binding.NameThirteen.text = ""
                            binding.NameThirteen.visibility = View.GONE
                            binding.NameFourteen.text = ""
                            binding.NameFourteen.visibility = View.GONE
                            binding.NameFifteen.text = ""
                            binding.NameFifteen.visibility = View.GONE
                            binding.NameSixteen.text = ""
                            binding.NameSixteen.visibility = View.GONE
                            binding.NameSeventeen.text = ""
                            binding.NameSeventeen.visibility = View.GONE
                            //线
                            binding.ViewOne.visibility = View.VISIBLE
                            binding.ViewTwo.visibility = View.VISIBLE
                            binding.ViewThree.visibility = View.VISIBLE
                            binding.ViewFour.visibility = View.GONE
                            binding.ViewFive.visibility = View.GONE
                            binding.ViewSix.visibility = View.GONE
                            binding.ViewSeven.visibility = View.GONE
                            binding.ViewEight.visibility = View.GONE
                            binding.ViewNine.visibility = View.GONE
                            binding.ViewTen.visibility = View.GONE
                            binding.ViewEleven.visibility = View.GONE
                            binding.ViewTwelve.visibility = View.GONE
                            binding.ViewThirteen.visibility = View.GONE
                            binding.ViewFourteen.visibility = View.GONE
                            binding.ViewFifteen.visibility = View.GONE
                            binding.ViewSixteen.visibility = View.GONE
                            binding.ViewSeventeen.visibility = View.GONE
                        }
                    }
                    "碎米率" -> {
                        binding.NameOne.text = "试样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "碎米质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "碎米率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "小碎米质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "小碎米率"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "黄粒米" -> {
                        binding.NameOne.text = "试样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "黄粒米质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "黄粒米率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "互混" -> {
                        binding.NameOne.text = "试样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "异种粮质量"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "互混率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                }
            }
            "大豆" -> {
                when (mSubclass) {
                    "杂质" -> {
                        binding.NameOne.text = "大样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "大样杂质"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "大样杂质率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "小样质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "小样杂质"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = "小样杂质率"
                        binding.NameSix.visibility = View.VISIBLE
                        binding.NameSeven.text = "总杂质率"
                        binding.NameSeven.visibility = View.VISIBLE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.VISIBLE
                        binding.ViewSeven.visibility = View.VISIBLE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "损伤粒率" -> {
                        binding.NameOne.text = "损伤粒(含热损伤粒)质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "损伤粒率"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "热损伤粒率" -> {
                        binding.NameOne.text = "热损伤粒质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "热损伤粒率"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "完整粒率" -> {
                        binding.NameOne.text = "未熟粒质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "完整粒率"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                }
            }
            "油菜籽" -> {
                when (mSubclass) {
                    "杂质" -> {
                        binding.NameOne.text = "大样质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "大样杂质"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "大样杂质率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = "小样质量"
                        binding.NameFour.visibility = View.VISIBLE
                        binding.NameFive.text = "小样杂质"
                        binding.NameFive.visibility = View.VISIBLE
                        binding.NameSix.text = "小样杂质率"
                        binding.NameSix.visibility = View.VISIBLE
                        binding.NameSeven.text = "总杂质率"
                        binding.NameSeven.visibility = View.VISIBLE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.VISIBLE
                        binding.ViewFive.visibility = View.VISIBLE
                        binding.ViewSix.visibility = View.VISIBLE
                        binding.ViewSeven.visibility = View.VISIBLE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "生芽粒" -> {
                        binding.NameOne.text = "生芽粒质量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "生芽粒率"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "生霉粒" -> {
                        binding.NameOne.text = "生霉粒重量"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "生霉粒率"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = ""
                        binding.NameThree.visibility = View.GONE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.GONE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "热损伤粒" -> {
                        binding.NameOne.text = "第一次"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "第二次"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "热损伤粒"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                    "未熟粒" -> {
                        binding.NameOne.text = "第一次"
                        binding.NameOne.visibility = View.VISIBLE
                        binding.NameTwo.text = "第二次"
                        binding.NameTwo.visibility = View.VISIBLE
                        binding.NameThree.text = "未熟粒率"
                        binding.NameThree.visibility = View.VISIBLE
                        binding.NameFour.text = ""
                        binding.NameFour.visibility = View.GONE
                        binding.NameFive.text = ""
                        binding.NameFive.visibility = View.GONE
                        binding.NameSix.text = ""
                        binding.NameSix.visibility = View.GONE
                        binding.NameSeven.text = ""
                        binding.NameSeven.visibility = View.GONE
                        binding.NameEight.text = ""
                        binding.NameEight.visibility = View.GONE
                        binding.NameNine.text = ""
                        binding.NameNine.visibility = View.GONE
                        binding.NameTen.text = ""
                        binding.NameTen.visibility = View.GONE
                        binding.NameEleven.text = ""
                        binding.NameEleven.visibility = View.GONE
                        binding.NameTwelve.text = ""
                        binding.NameTwelve.visibility = View.GONE
                        binding.NameThirteen.text = ""
                        binding.NameThirteen.visibility = View.GONE
                        binding.NameFourteen.text = ""
                        binding.NameFourteen.visibility = View.GONE
                        binding.NameFifteen.text = ""
                        binding.NameFifteen.visibility = View.GONE
                        binding.NameSixteen.text = ""
                        binding.NameSixteen.visibility = View.GONE
                        binding.NameSeventeen.text = ""
                        binding.NameSeventeen.visibility = View.GONE
                        //线
                        binding.ViewOne.visibility = View.VISIBLE
                        binding.ViewTwo.visibility = View.VISIBLE
                        binding.ViewThree.visibility = View.VISIBLE
                        binding.ViewFour.visibility = View.GONE
                        binding.ViewFive.visibility = View.GONE
                        binding.ViewSix.visibility = View.GONE
                        binding.ViewSeven.visibility = View.GONE
                        binding.ViewEight.visibility = View.GONE
                        binding.ViewNine.visibility = View.GONE
                        binding.ViewTen.visibility = View.GONE
                        binding.ViewEleven.visibility = View.GONE
                        binding.ViewTwelve.visibility = View.GONE
                        binding.ViewThirteen.visibility = View.GONE
                        binding.ViewFourteen.visibility = View.GONE
                        binding.ViewFifteen.visibility = View.GONE
                        binding.ViewSixteen.visibility = View.GONE
                        binding.ViewSeventeen.visibility = View.GONE
                    }
                }
            }
        }
        mRecordAdapter?.notifyDataSetChanged()
    }

    /**
     * 分页
     */
    fun paging(){
        when (mMainClass) {
            "稻谷" -> {
                mRecordRiceList = RecordRiceDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordRice(mRecordRiceList)
            }
            "小麦" -> {
                mRecordWheatList = RecordWheatDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordWheat(mRecordWheatList)
            }
            "玉米" -> {
                mRecordCornList = RecordCornDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordCorn(mRecordCornList)
            }
            "大米" -> {
                mRecordDaMiList = RecordDaMiDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordDaMi(mRecordDaMiList)
            }
            "大豆" -> {
                mRecordSoybeanList = RecordSoybeanDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordSoybean(mRecordSoybeanList)
            }
            "油菜籽" -> {
                mRecordRapeseedList = RecordRapeseedDao.getInstance().PagingFetch(page, uniqueId)
                mRecordAdapter.setRecordRapeseed(mRecordRapeseedList)
            }
        }
    }

    /**
     * 选中
     */
    fun CheckBoxSelect(Select : Boolean){
        when (mMainClass) {
            "稻谷" -> {
                mRecordRiceList = RecordRiceDao.getInstance().PagingFetch(page, uniqueId)
                for (mRecordRice in mRecordRiceList){
                    mRecordRice.select = Select
                }
                mRecordAdapter.setRecordRice(mRecordRiceList)
            }
            "小麦" -> {
                mRecordWheatList = RecordWheatDao.getInstance().PagingFetch(page, uniqueId)
                for (mRecordWheat in mRecordWheatList){
                    mRecordWheat.select = Select
                }
                mRecordAdapter.setRecordWheat(mRecordWheatList)
            }
            "玉米" -> {
                mRecordCornList = RecordCornDao.getInstance().PagingFetch(page, uniqueId)
                for (mRecordCorn in mRecordCornList){
                    mRecordCorn.select = Select
                }
                mRecordAdapter.setRecordCorn(mRecordCornList)
            }
            "大米" -> {
                mRecordDaMiList = RecordDaMiDao.getInstance().PagingFetch(page, uniqueId)
                for (mRecordDaMi in mRecordDaMiList){
                    mRecordDaMi.select = Select
                }
                mRecordAdapter.setRecordDaMi(mRecordDaMiList)
            }
            "大豆" -> {
                mRecordSoybeanList = RecordSoybeanDao.getInstance().PagingFetch(page, uniqueId)
                for (mRecordSoybean in mRecordSoybeanList){
                    mRecordSoybean.select = Select
                }
                mRecordAdapter.setRecordSoybean(mRecordSoybeanList)
            }
            "油菜籽" -> {
                mRecordRapeseedList = RecordRapeseedDao.getInstance().PagingFetch(page, uniqueId)
                for (mRecordRapeseed in mRecordRapeseedList){
                    mRecordRapeseed.select = Select
                }
                mRecordAdapter.setRecordRapeseed(mRecordRapeseedList)
            }
        }
    }
}